/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidade;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Ederson
 */
@Entity
@Table(name = "tarefa")
@NamedQueries({
    @NamedQuery(name = "Tarefa.findAll", query = "SELECT t FROM Tarefa t"),
    @NamedQuery(name = "Tarefa.findByIdTarefa", query = "SELECT t FROM Tarefa t WHERE t.idTarefa = :idTarefa"),
    @NamedQuery(name = "Tarefa.findByCodigoAgendamento", query = "SELECT t FROM Tarefa t WHERE t.codigoAgendamento = :codigoAgendamento"),
    @NamedQuery(name = "Tarefa.findByHorario", query = "SELECT t FROM Tarefa t WHERE t.horario = :horario"),
    @NamedQuery(name = "Tarefa.findByDescricao", query = "SELECT t FROM Tarefa t WHERE t.descricao = :descricao"),
    @NamedQuery(name = "Tarefa.findByPeriodicidade", query = "SELECT t FROM Tarefa t WHERE t.periodicidade = :periodicidade"),
    @NamedQuery(name = "Tarefa.findByDia", query = "SELECT t FROM Tarefa t WHERE t.dia = :dia"),
    @NamedQuery(name = "Tarefa.findByStatus", query = "SELECT t FROM Tarefa t WHERE t.status = :status"),
    @NamedQuery(name = "Tarefa.findByAcao", query = "SELECT t FROM Tarefa t WHERE t.acao = :acao"),
    @NamedQuery(name = "Tarefa.findByResponsavel", query = "SELECT t FROM Tarefa t WHERE t.responsavel = :responsavel")})
public class Tarefa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_tarefa")
    private Integer idTarefa;
    @Basic(optional = false)
    @Column(name = "codigo_agendamento")
    private int codigoAgendamento;
    @Basic(optional = false)
    @Column(name = "horario")
    @Temporal(TemporalType.TIME)
    private Date horario;
    @Basic(optional = false)
    @Column(name = "descricao")
    private String descricao;
    @Basic(optional = false)
    @Column(name = "periodicidade")
    private String periodicidade;
    @Basic(optional = false)
    @Column(name = "dia")
    private String dia;
    @Basic(optional = false)
    @Column(name = "status")
    private String status;
    @Basic(optional = false)
    @Column(name = "acao")
    private String acao;
    @Basic(optional = false)
    @Column(name = "responsavel")
    private String responsavel;
    @JoinColumn(name = "id_responsavel", referencedColumnName = "id_responsavel")
    @ManyToOne(optional = false)
    private Responsavel idResponsavel;
    @JoinColumn(name = "id_login", referencedColumnName = "id_login")
    @ManyToOne(optional = false)
    private Login idLogin;

    public Tarefa() {
    }

    public Tarefa(Integer idTarefa) {
        this.idTarefa = idTarefa;
    }

    public Tarefa(Integer idTarefa, int codigoAgendamento, Date horario, String descricao, String periodicidade, String dia, String status, String acao, String responsavel) {
        this.idTarefa = idTarefa;
        this.codigoAgendamento = codigoAgendamento;
        this.horario = horario;
        this.descricao = descricao;
        this.periodicidade = periodicidade;
        this.dia = dia;
        this.status = status;
        this.acao = acao;
        this.responsavel = responsavel;
    }

    public Integer getIdTarefa() {
        return idTarefa;
    }

    public void setIdTarefa(Integer idTarefa) {
        this.idTarefa = idTarefa;
    }

    public int getCodigoAgendamento() {
        return codigoAgendamento;
    }

    public void setCodigoAgendamento(int codigoAgendamento) {
        this.codigoAgendamento = codigoAgendamento;
    }

    public Date getHorario() {
        return horario;
    }

    public void setHorario(Date horario) {
        this.horario = horario;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public String getPeriodicidade() {
        return periodicidade;
    }

    public void setPeriodicidade(String periodicidade) {
        this.periodicidade = periodicidade;
    }

    public String getDia() {
        return dia;
    }

    public void setDia(String dia) {
        this.dia = dia;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getAcao() {
        return acao;
    }

    public void setAcao(String acao) {
        this.acao = acao;
    }

    public String getResponsavel() {
        return responsavel;
    }

    public void setResponsavel(String responsavel) {
        this.responsavel = responsavel;
    }

    public Responsavel getIdResponsavel() {
        return idResponsavel;
    }

    public void setIdResponsavel(Responsavel idResponsavel) {
        this.idResponsavel = idResponsavel;
    }

    public Login getIdLogin() {
        return idLogin;
    }

    public void setIdLogin(Login idLogin) {
        this.idLogin = idLogin;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTarefa != null ? idTarefa.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tarefa)) {
            return false;
        }
        Tarefa other = (Tarefa) object;
        if ((this.idTarefa == null && other.idTarefa != null) || (this.idTarefa != null && !this.idTarefa.equals(other.idTarefa))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidade.Tarefa[ idTarefa=" + idTarefa + " ]";
    }
    
}
